package com.bd.scm.module.consume.controller;


import com.bd.scm.module.consume.service.XfTimeService;
import com.bd.utils.vo.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Mason
 * @since 2020-01-03
 */
@RestController
@RequestMapping("/xfTime")
public class XfTimeController {
    private Logger log = LoggerFactory.getLogger("xfTimeDataLogger");

    @Autowired
    private XfTimeService xfTimeService;
    /**
     * 获取就餐时段集合.
     *
     * @return
     */
    @PostMapping("getMealTypeList")
    public Result getMealTypeList() {
        Result result = null;
        try {
            result = Result.ok(xfTimeService.list());
        } catch (Exception e) {
            e.printStackTrace();
            log.error(e.getMessage());
            result = Result.error("程序内部错误");
        }
        return result;
    }
}

